package com.ruoyi.order.feign;


import com.ruoyi.order.feign.domain.Address;
import com.ruoyi.order.domain.JsonData;
import com.ruoyi.order.feign.domain.CartItemVO;
import com.ruoyi.order.request.LockProductRequest;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

@FeignClient(value = "ruoyi-product")
public interface ProductFeignService {


    /**
     * 获取购物车的最新商品价格（也会清空对应的购物车商品）
     * @param productIdList
     * @return
     */
    @PostMapping("/cart/confirm_order_cart_items")
    JsonData confirmOrderCartItem(@RequestBody List<Long> productIdList);

    /**
     * 锁定商品购物项库存
     * @param
     * @return
     */
//    @PostMapping("/sys/product/lock_products")
//    JsonData lockProductStock(@RequestBody LockProductRequest lockProductRequest);


    @GetMapping("/address/feign/{id}")
    public Address getAddressById(@PathVariable("id") String id);
    /**
     * 锁定商品购物项库存
     * @param lockProductRequest
     * @return
     */
    @PostMapping("/product/lock_products")
    JsonData lockProductStock(LockProductRequest lockProductRequest);
}
